home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Utilities / Programming / EnterAct 3.5 / Drag_on Modules / hAWK programs / $CommaString < prev    next >
Encoding:
Text File  |  1993-08-28  |  447 b   |  21 lines  |  [TEXT/KEEN]

  1. #$CommaString : 
  2. #Select a bunch of enums, and run Hawk on the front selection
  3. # -optionally select the entire enum body from '{' to '}' with Balance
  4. #Leave "Show std out" and "Select all of stdout" checked
  5. #-generates strings, one for each term
  6.  
  7.     {    gsub(/=[^,]*/, " ")
  8.         gsub(/=(.)*$/, " ")
  9.         gsub(/[,{};]/, " ")
  10.         for ( k = 1; k <= NF; k++)
  11.             case[++N] = $k
  12.             
  13.     }
  14.  
  15. END    {
  16.     for (k = 1; k <= N; ++k)
  17.         {
  18.         print "\"\",\t/*", case[k], "*/"
  19.         }
  20.     }
  21.